package day27;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

//客户端数据通过Scanner无限写入
public class client2 {
    public static void main(String[] args) throws IOException {
        Scanner sc=new Scanner(System.in);
        Socket client=new Socket("192.168.9.88",9999);
        OutputStream os=client.getOutputStream();
        while (true){
            System.out.print("请输入你要向服务端写入的数据:");
            String str=sc.nextLine();
            os.write((str+"\n").getBytes());
        }
    }
}
